// routes/banner.js 使用的中间件

const testAdd = (req, res, next) => {
    const { title, link } = req.body
    const img_url = '/public/banner/' + req.file.filename
    if (!title) return next(4)
    req.body.img_url = img_url
    next()
  }
  
  module.exports = {
    testAdd
  }
  